import java.util.Scanner;

public class Ex4_36{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int num = input.nextInt();
		int sum = 0;
		String s = "";
		for (int i = 9; i >= 1; i--){
			int d = num % 10;
			s = (char)('0' + d) + s;
			sum += d * i;
			num /= 10;
		}
		System.out.print(s);
		sum %= 11;
		if (sum == 10)
			System.out.println('X');
		else
			System.out.println((char)('0' + sum));
	}
}
